package com.neusoft.mapper;

import com.neusoft.domain.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserDao {

    @Select("select * from user where userId = #{userId}")
    User getUserById(String userId);

    @Insert("insert into user(userId,userName,password,userSex) values(#{userId},#{userName},#{password},#{userSex})")
    int saveUser(User user);

    @Select("select * from user where userId = #{userId} and password = #{password}")
    User getUserByIdByPass(@Param("userId") String userId,@Param("password") String password);
}
